package com.wms.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.wms.mapper.LogisticsPriceMapper;
import com.wms.pojo.LogisticsPrice;
import com.wms.pojo.PageResult;
import com.wms.service.LogisticsPriceService;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogisticsPriceServiceImpl extends ServiceImpl<LogisticsPriceMapper, LogisticsPrice> implements LogisticsPriceService {
    @Override
    public PageResult querypage(Integer page, Integer pageSize, String companyName, Integer category) {
        PageHelper.startPage(page,pageSize);
        List<LogisticsPrice> list = getBaseMapper().queryPage(companyName,category);
        Page<LogisticsPrice> pricePage = (Page<LogisticsPrice>) list;
        return new PageResult(pricePage.getTotal(),pricePage.getResult());
    }
}
